<template>
  <!-- 素材库页面———组件 -->
  <div class="commerce">
    <div class="line"></div>
    <div class="common">
      <div class="common_top">
        <p>电商淘宝</p>
        <p>E-COMMERCE</p>
      </div>
      <div class="common_bottom">
        <div
          v-for="(item, index) in data2"
          :key="index"
          class="combtm"
          @click="routerxq(item.id)"
        >
          <p class="combtm_top"><img :src="item.image" alt="" /></p>
          <div class="jian">
            <p>{{ item.title }}</p>
            <p>点击下载</p>
          </div>
        </div>
      </div>
      <button @click="routers()">查看更多素材</button>
    </div>
  </div>
</template>

<script>
export default {
  name: "commerce",
  components: {},
  props: {
    data2: Array,
  },
  data() {
    return {};
  },
  methods: {
    routers() {
      this.$router.push("/Material");
    },
    routerxq(a) {
      this.$router.push({
        path: "/Sourexq",
        query: {
          id: a,
          name: 4,
        },
      });
    },
  },
  created() {},
};
</script>
<style lang="scss" scoped>
.commerce {
  width: 100%;
  background-color: #fff;
  margin: 0 auto;

  .line {
    width: 1200px;
    height: 38px;
    background: #f7f8fa;
    margin: 34px auto 0;
  }

  .common {
    width: 1200px;
    margin: 0 auto;

    .common_top {
      width: 100%;
      text-align: center;
      margin-top: 52px;

      :nth-child(1) {
        color: #333;
        font-size: 28px;
      }

      :nth-child(2) {
        color: #999;
        margin-top: 10px;
        font-size: 18px;
      }
    }

    .common_bottom {
      width: 100%;
      margin-top: 20px;
      display: flex;
      justify-content: space-around;
      flex-wrap: wrap;

      .combtm {
        width: 266px;
        margin-top: 42px;
        background: #f5f6f9;
        box-shadow: 0px 0px 16px 4px rgba(0, 0, 0, 0.3);
        border-radius: 5px;
        cursor: pointer;

        .combtm_top {
          width: 100%;
          height: 180px;

          img {
            display: block;
            width: 100%;
            height: 180px;
            object-fit: cover;
          }
        }

        .jian {
          width: 95%;
          margin: 0 auto;
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding-bottom: 10px;

          :nth-child(1) {
            width: 60%;
            color: #333;
            font-size: 18px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-top: 10px;
          }

          :nth-child(2) {
            width: 35%;
            color: #999;
            margin-top: 20px;
            padding: 5px 10px;
            font-size: 16px;
            background: #d7f0ff;
            border-radius: 16px;
            color: #4dcaf3;
            text-align: center;
            cursor: pointer;
          }
        }
      }
    }

    button {
      display: block;
      width: 214px;
      height: 58px;
      font-size: 20px;
      color: #ffffff;
      line-height: 48px;
      background: #33cfff;
      border-radius: 29px;
      outline: none;
      border: none;
      margin: 43px auto 0;
      text-align: center;
      cursor: pointer;
    }
  }
}
</style>
